package com.kkb.service.impl;

import com.kkb.dao.AccountDao;
import com.kkb.pojo.Account;
import com.kkb.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;

    @Override
    public void addAccount(Account newAccount) {
        this.accountDao.addAccount(newAccount);
    }

    @Override
    public void deleteAccountById(Integer id) {
        this.accountDao.deleteAccountById(id);
    }

    @Override
    public void updateAccount(Account account) {
        this.accountDao.updateAccount(account);
    }

    @Override
    public Account findAccountById(Integer id) {
        return this.accountDao.findAccountById(id);
    }

    @Override
    public List<Account> findAccountsByName(String partname) {
        return this.accountDao.findAccountsByName(partname);
    }

    @Override
    public List<Account> findAccounts() {
        return this.accountDao.findAccounts();
    }
}
